#ifndef CODE_GENERATOR_INTERNAL_H_
#define CODE_GENERATOR_INTERNAL_H_
#include "global.h"


namespace tinyscript{
namespace internal{
class GlobalVariableReferenceTable;
class DataSegment;
class CodeSegment;
// For each code unit, the output of code generation contains following data structure.
// 1. A reference table which stores the string/name points to the global value. 
// 2. A output table which stores the string/name points to the global value defined inside
// of this module/compilation unit. 
// 3. A data segment which contains 2 sub segment, 1 points to the string constants , the
// other points to the list definition constants.
// 4. Code segment, which contains a flat segment fulls of instructions.

class ComopilationUnit {
public:
	DataSegment* data_segment() const {
		return data_segment_;
	}
	CodeSegment* code_segment() const {
		return code_segment_;
	}
	GlobalVariableReferenceTable* global_var_table() const {
		return global_var_table_;
	}

private:
	GlobalVariableReferenceTable* global_var_table_;
	DataSegment* data_segment_;
	CodeSegment* code_segment_;
};


// A segment base is a base class that 
class SegmentBase {
public:
};




#endif // CODE_GENERATOR_INTERNAL_H_